<!doctype html>
<html>
<head>
<meta charset='UTF-8'><meta name='viewport' content='width=device-width initial-scale=1'>
<title>说明文档</title><style type='text/css'>html {overflow-x: initial !important;}:root { --bg-color:#ffffff; --text-color:#333333; --select-text-bg-color:#B5D6FC; --select-text-font-color:auto; --monospace:"Lucida Console",Consolas,"Courier",monospace; }
html { font-size: 14px; background-color: var(--bg-color); color: var(--text-color); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
body { margin: 0px; padding: 0px; height: auto; bottom: 0px; top: 0px; left: 0px; right: 0px; font-size: 1rem; line-height: 1.42857; overflow-x: hidden; background: inherit; tab-size: 4; }
iframe { margin: auto; }
a.url { word-break: break-all; }
a:active, a:hover { outline: 0px; }
.in-text-selection, ::selection { text-shadow: none; background: var(--select-text-bg-color); color: var(--select-text-font-color); }
#write { margin: 0px auto; height: auto; width: inherit; word-break: normal; overflow-wrap: break-word; position: relative; white-space: normal; overflow-x: visible; padding-top: 40px; }
#write.first-line-indent p { text-indent: 2em; }
#write.first-line-indent li p, #write.first-line-indent p * { text-indent: 0px; }
#write.first-line-indent li { margin-left: 2em; }
.for-image #write { padding-left: 8px; padding-right: 8px; }
body.typora-export { padding-left: 30px; padding-right: 30px; }
.typora-export .footnote-line, .typora-export li, .typora-export p { white-space: pre-wrap; }
@media screen and (max-width: 500px) {
  body.typora-export { padding-left: 0px; padding-right: 0px; }
  #write { padding-left: 20px; padding-right: 20px; }
  .CodeMirror-sizer { margin-left: 0px !important; }
  .CodeMirror-gutters { display: none !important; }
}
#write li > figure:last-child { margin-bottom: 0.5rem; }
#write ol, #write ul { position: relative; }
img { max-width: 100%; vertical-align: middle; }
button, input, select, textarea { color: inherit; font: inherit; }
input[type="checkbox"], input[type="radio"] { line-height: normal; padding: 0px; }
*, ::after, ::before { box-sizing: border-box; }
#write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write p, #write pre { width: inherit; }
#write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write p { position: relative; }
p { line-height: inherit; }
h1, h2, h3, h4, h5, h6 { break-after: avoid-page; break-inside: avoid; orphans: 2; }
p { orphans: 4; }
h1 { font-size: 2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.6rem; }
h4 { font-size: 1.4rem; }
h5 { font-size: 1.2rem; }
h6 { font-size: 1rem; }
.md-math-block, .md-rawblock, h1, h2, h3, h4, h5, h6, p { margin-top: 1rem; margin-bottom: 1rem; }
.hidden { display: none; }
.md-blockmeta { color: rgb(204, 204, 204); font-weight: 700; font-style: italic; }
a { cursor: pointer; }
sup.md-footnote { padding: 2px 4px; background-color: rgba(238, 238, 238, 0.7); color: rgb(85, 85, 85); border-radius: 4px; cursor: pointer; }
sup.md-footnote a, sup.md-footnote a:hover { color: inherit; text-transform: inherit; text-decoration: inherit; }
#write input[type="checkbox"] { cursor: pointer; width: inherit; height: inherit; }
figure { overflow-x: auto; margin: 1.2em 0px; max-width: calc(100% + 16px); padding: 0px; }
figure > table { margin: 0px !important; }
tr { break-inside: avoid; break-after: auto; }
thead { display: table-header-group; }
table { border-collapse: collapse; border-spacing: 0px; width: 100%; overflow: auto; break-inside: auto; text-align: left; }
table.md-table td { min-width: 32px; }
.CodeMirror-gutters { border-right: 0px; background-color: inherit; }
.CodeMirror-linenumber { user-select: none; }
.CodeMirror { text-align: left; }
.CodeMirror-placeholder { opacity: 0.3; }
.CodeMirror pre { padding: 0px 4px; }
.CodeMirror-lines { padding: 0px; }
div.hr:focus { cursor: none; }
#write pre { white-space: pre-wrap; }
#write.fences-no-line-wrapping pre { white-space: pre; }
#write pre.ty-contain-cm { white-space: normal; }
.CodeMirror-gutters { margin-right: 4px; }
.md-fences { font-size: 0.9rem; display: block; break-inside: avoid; text-align: left; overflow: visible; white-space: pre; background: inherit; position: relative !important; }
.md-diagram-panel { width: 100%; margin-top: 10px; text-align: center; padding-top: 0px; padding-bottom: 8px; overflow-x: auto; }
#write .md-fences.mock-cm { white-space: pre-wrap; }
.md-fences.md-fences-with-lineno { padding-left: 0px; }
#write.fences-no-line-wrapping .md-fences.mock-cm { white-space: pre; overflow-x: auto; }
.md-fences.mock-cm.md-fences-with-lineno { padding-left: 8px; }
.CodeMirror-line, twitterwidget { break-inside: avoid; }
.footnotes { opacity: 0.8; font-size: 0.9rem; margin-top: 1em; margin-bottom: 1em; }
.footnotes + .footnotes { margin-top: 0px; }
.md-reset { margin: 0px; padding: 0px; border: 0px; outline: 0px; vertical-align: top; background: 0px 0px; text-decoration: none; text-shadow: none; float: none; position: static; width: auto; height: auto; white-space: nowrap; cursor: inherit; -webkit-tap-highlight-color: transparent; line-height: normal; font-weight: 400; text-align: left; box-sizing: content-box; direction: ltr; }
li div { padding-top: 0px; }
blockquote { margin: 1rem 0px; }
li .mathjax-block, li p { margin: 0.5rem 0px; }
li { margin: 0px; position: relative; }
blockquote > :last-child { margin-bottom: 0px; }
blockquote > :first-child, li > :first-child { margin-top: 0px; }
.footnotes-area { color: rgb(136, 136, 136); margin-top: 0.714rem; padding-bottom: 0.143rem; white-space: normal; }
#write .footnote-line { white-space: pre-wrap; }
@media print {
  body, html { border: 1px solid transparent; height: 99%; break-after: avoid; break-before: avoid; }
  #write { margin-top: 0px; padding-top: 0px; border-color: transparent !important; }
  .typora-export * { -webkit-print-color-adjust: exact; }
  html.blink-to-pdf { font-size: 13px; }
  .typora-export #write { padding-left: 32px; padding-right: 32px; padding-bottom: 0px; break-after: avoid; }
  .typora-export #write::after { height: 0px; }
}
.footnote-line { margin-top: 0.714em; font-size: 0.7em; }
a img, img a { cursor: pointer; }
pre.md-meta-block { font-size: 0.8rem; min-height: 0.8rem; white-space: pre-wrap; background: rgb(204, 204, 204); display: block; overflow-x: hidden; }
p > .md-image:only-child:not(.md-img-error) img, p > img:only-child { display: block; margin: auto; }
p > .md-image:only-child { display: inline-block; width: 100%; }
#write .MathJax_Display { margin: 0.8em 0px 0px; }
.md-math-block { width: 100%; }
.md-math-block:not(:empty)::after { display: none; }
[contenteditable="true"]:active, [contenteditable="true"]:focus { outline: 0px; box-shadow: none; }
.md-task-list-item { position: relative; list-style-type: none; }
.task-list-item.md-task-list-item { padding-left: 0px; }
.md-task-list-item > input { position: absolute; top: 0px; left: 0px; margin-left: -1.2em; margin-top: calc(1em - 10px); border: none; }
.math { font-size: 1rem; }
.md-toc { min-height: 3.58rem; position: relative; font-size: 0.9rem; border-radius: 10px; }
.md-toc-content { position: relative; margin-left: 0px; }
.md-toc-content::after, .md-toc::after { display: none; }
.md-toc-item { display: block; color: rgb(65, 131, 196); }
.md-toc-item a { text-decoration: none; }
.md-toc-inner:hover { text-decoration: underline; }
.md-toc-inner { display: inline-block; cursor: pointer; }
.md-toc-h1 .md-toc-inner { margin-left: 0px; font-weight: 700; }
.md-toc-h2 .md-toc-inner { margin-left: 2em; }
.md-toc-h3 .md-toc-inner { margin-left: 4em; }
.md-toc-h4 .md-toc-inner { margin-left: 6em; }
.md-toc-h5 .md-toc-inner { margin-left: 8em; }
.md-toc-h6 .md-toc-inner { margin-left: 10em; }
@media screen and (max-width: 48em) {
  .md-toc-h3 .md-toc-inner { margin-left: 3.5em; }
  .md-toc-h4 .md-toc-inner { margin-left: 5em; }
  .md-toc-h5 .md-toc-inner { margin-left: 6.5em; }
  .md-toc-h6 .md-toc-inner { margin-left: 8em; }
}
a.md-toc-inner { font-size: inherit; font-style: inherit; font-weight: inherit; line-height: inherit; }
.footnote-line a:not(.reversefootnote) { color: inherit; }
.md-attr { display: none; }
.md-fn-count::after { content: "."; }
code, pre, samp, tt { font-family: var(--monospace); }
kbd { margin: 0px 0.1em; padding: 0.1em 0.6em; font-size: 0.8em; color: rgb(36, 39, 41); background: rgb(255, 255, 255); border: 1px solid rgb(173, 179, 185); border-radius: 3px; box-shadow: rgba(12, 13, 14, 0.2) 0px 1px 0px, rgb(255, 255, 255) 0px 0px 0px 2px inset; white-space: nowrap; vertical-align: middle; }
.md-comment { color: rgb(162, 127, 3); opacity: 0.8; font-family: var(--monospace); }
code { text-align: left; vertical-align: initial; }
a.md-print-anchor { white-space: pre !important; border-width: initial !important; border-style: none !important; border-color: initial !important; display: inline-block !important; position: absolute !important; width: 1px !important; right: 0px !important; outline: 0px !important; background: 0px 0px !important; text-decoration: initial !important; text-shadow: initial !important; }
.md-inline-math .MathJax_SVG .noError { display: none !important; }
.html-for-mac .inline-math-svg .MathJax_SVG { vertical-align: 0.2px; }
.md-math-block .MathJax_SVG_Display { text-align: center; margin: 0px; position: relative; text-indent: 0px; max-width: none; max-height: none; min-height: 0px; min-width: 100%; width: auto; overflow-y: hidden; display: block !important; }
.MathJax_SVG_Display, .md-inline-math .MathJax_SVG_Display { width: auto; margin: inherit; display: inline-block !important; }
.MathJax_SVG .MJX-monospace { font-family: var(--monospace); }
.MathJax_SVG .MJX-sans-serif { font-family: sans-serif; }
.MathJax_SVG { display: inline; font-style: normal; font-weight: 400; line-height: normal; zoom: 90%; text-indent: 0px; text-align: left; text-transform: none; letter-spacing: normal; word-spacing: normal; overflow-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; border: 0px; padding: 0px; margin: 0px; }
.MathJax_SVG * { transition: none 0s ease 0s; }
.MathJax_SVG_Display svg { vertical-align: middle !important; margin-bottom: 0px !important; margin-top: 0px !important; }
.os-windows.monocolor-emoji .md-emoji { font-family: "Segoe UI Symbol", sans-serif; }
.md-diagram-panel > svg { max-width: 100%; }
[lang="mermaid"] svg, [lang="flow"] svg { max-width: 100%; height: auto; }
[lang="mermaid"] .node text { font-size: 1rem; }
table tr th { border-bottom: 0px; }
video { max-width: 100%; display: block; margin: 0px auto; }
iframe { max-width: 100%; width: 100%; border: none; }
.highlight td, .highlight tr { border: 0px; }


.CodeMirror { height: auto; }
.CodeMirror.cm-s-inner { background: inherit; }
.CodeMirror-scroll { overflow: auto hidden; z-index: 3; }
.CodeMirror-gutter-filler, .CodeMirror-scrollbar-filler { background-color: rgb(255, 255, 255); }
.CodeMirror-gutters { border-right: 1px solid rgb(221, 221, 221); background: inherit; white-space: nowrap; }
.CodeMirror-linenumber { padding: 0px 3px 0px 5px; text-align: right; color: rgb(153, 153, 153); }
.cm-s-inner .cm-keyword { color: rgb(119, 0, 136); }
.cm-s-inner .cm-atom, .cm-s-inner.cm-atom { color: rgb(34, 17, 153); }
.cm-s-inner .cm-number { color: rgb(17, 102, 68); }
.cm-s-inner .cm-def { color: rgb(0, 0, 255); }
.cm-s-inner .cm-variable { color: rgb(0, 0, 0); }
.cm-s-inner .cm-variable-2 { color: rgb(0, 85, 170); }
.cm-s-inner .cm-variable-3 { color: rgb(0, 136, 85); }
.cm-s-inner .cm-string { color: rgb(170, 17, 17); }
.cm-s-inner .cm-property { color: rgb(0, 0, 0); }
.cm-s-inner .cm-operator { color: rgb(152, 26, 26); }
.cm-s-inner .cm-comment, .cm-s-inner.cm-comment { color: rgb(170, 85, 0); }
.cm-s-inner .cm-string-2 { color: rgb(255, 85, 0); }
.cm-s-inner .cm-meta { color: rgb(85, 85, 85); }
.cm-s-inner .cm-qualifier { color: rgb(85, 85, 85); }
.cm-s-inner .cm-builtin { color: rgb(51, 0, 170); }
.cm-s-inner .cm-bracket { color: rgb(153, 153, 119); }
.cm-s-inner .cm-tag { color: rgb(17, 119, 0); }
.cm-s-inner .cm-attribute { color: rgb(0, 0, 204); }
.cm-s-inner .cm-header, .cm-s-inner.cm-header { color: rgb(0, 0, 255); }
.cm-s-inner .cm-quote, .cm-s-inner.cm-quote { color: rgb(0, 153, 0); }
.cm-s-inner .cm-hr, .cm-s-inner.cm-hr { color: rgb(153, 153, 153); }
.cm-s-inner .cm-link, .cm-s-inner.cm-link { color: rgb(0, 0, 204); }
.cm-negative { color: rgb(221, 68, 68); }
.cm-positive { color: rgb(34, 153, 34); }
.cm-header, .cm-strong { font-weight: 700; }
.cm-del { text-decoration: line-through; }
.cm-em { font-style: italic; }
.cm-link { text-decoration: underline; }
.cm-error { color: red; }
.cm-invalidchar { color: red; }
.cm-constant { color: rgb(38, 139, 210); }
.cm-defined { color: rgb(181, 137, 0); }
div.CodeMirror span.CodeMirror-matchingbracket { color: rgb(0, 255, 0); }
div.CodeMirror span.CodeMirror-nonmatchingbracket { color: rgb(255, 34, 34); }
.cm-s-inner .CodeMirror-activeline-background { background: inherit; }
.CodeMirror { position: relative; overflow: hidden; }
.CodeMirror-scroll { height: 100%; outline: 0px; position: relative; box-sizing: content-box; background: inherit; }
.CodeMirror-sizer { position: relative; }
.CodeMirror-gutter-filler, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-vscrollbar { position: absolute; z-index: 6; display: none; }
.CodeMirror-vscrollbar { right: 0px; top: 0px; overflow: hidden; }
.CodeMirror-hscrollbar { bottom: 0px; left: 0px; overflow: hidden; }
.CodeMirror-scrollbar-filler { right: 0px; bottom: 0px; }
.CodeMirror-gutter-filler { left: 0px; bottom: 0px; }
.CodeMirror-gutters { position: absolute; left: 0px; top: 0px; padding-bottom: 30px; z-index: 3; }
.CodeMirror-gutter { white-space: normal; height: 100%; box-sizing: content-box; padding-bottom: 30px; margin-bottom: -32px; display: inline-block; }
.CodeMirror-gutter-wrapper { position: absolute; z-index: 4; background: 0px 0px !important; border: none !important; }
.CodeMirror-gutter-background { position: absolute; top: 0px; bottom: 0px; z-index: 4; }
.CodeMirror-gutter-elt { position: absolute; cursor: default; z-index: 4; }
.CodeMirror-lines { cursor: text; }
.CodeMirror pre { border-radius: 0px; border-width: 0px; background: 0px 0px; font-family: inherit; font-size: inherit; margin: 0px; white-space: pre; overflow-wrap: normal; color: inherit; z-index: 2; position: relative; overflow: visible; }
.CodeMirror-wrap pre { overflow-wrap: break-word; white-space: pre-wrap; word-break: normal; }
.CodeMirror-code pre { border-right: 30px solid transparent; width: fit-content; }
.CodeMirror-wrap .CodeMirror-code pre { border-right: none; width: auto; }
.CodeMirror-linebackground { position: absolute; left: 0px; right: 0px; top: 0px; bottom: 0px; z-index: 0; }
.CodeMirror-linewidget { position: relative; z-index: 2; overflow: auto; }
.CodeMirror-wrap .CodeMirror-scroll { overflow-x: hidden; }
.CodeMirror-measure { position: absolute; width: 100%; height: 0px; overflow: hidden; visibility: hidden; }
.CodeMirror-measure pre { position: static; }
.CodeMirror div.CodeMirror-cursor { position: absolute; visibility: hidden; border-right: none; width: 0px; }
.CodeMirror div.CodeMirror-cursor { visibility: hidden; }
.CodeMirror-focused div.CodeMirror-cursor { visibility: inherit; }
.cm-searching { background: rgba(255, 255, 0, 0.4); }
@media print {
  .CodeMirror div.CodeMirror-cursor { visibility: hidden; }
}


:root { --side-bar-bg-color: #fafafa; --control-text-color: #777; }
html { font-size: 16px; }
body { font-family: "Open Sans", "Clear Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; color: rgb(51, 51, 51); line-height: 1.6; }
#write { max-width: 860px; margin: 0px auto; padding: 30px 30px 100px; }
#write > ul:first-child, #write > ol:first-child { margin-top: 30px; }
a { color: rgb(65, 131, 196); }
h1, h2, h3, h4, h5, h6 { position: relative; margin-top: 1rem; margin-bottom: 1rem; font-weight: bold; line-height: 1.4; cursor: text; }
h1:hover a.anchor, h2:hover a.anchor, h3:hover a.anchor, h4:hover a.anchor, h5:hover a.anchor, h6:hover a.anchor { text-decoration: none; }
h1 tt, h1 code { font-size: inherit; }
h2 tt, h2 code { font-size: inherit; }
h3 tt, h3 code { font-size: inherit; }
h4 tt, h4 code { font-size: inherit; }
h5 tt, h5 code { font-size: inherit; }
h6 tt, h6 code { font-size: inherit; }
h1 { padding-bottom: 0.3em; font-size: 2.25em; line-height: 1.2; border-bottom: 1px solid rgb(238, 238, 238); }
h2 { padding-bottom: 0.3em; font-size: 1.75em; line-height: 1.225; border-bottom: 1px solid rgb(238, 238, 238); }
h3 { font-size: 1.5em; line-height: 1.43; }
h4 { font-size: 1.25em; }
h5 { font-size: 1em; }
h6 { font-size: 1em; color: rgb(119, 119, 119); }
p, blockquote, ul, ol, dl, table { margin: 0.8em 0px; }
li > ol, li > ul { margin: 0px; }
hr { height: 2px; padding: 0px; margin: 16px 0px; background-color: rgb(231, 231, 231); border: 0px none; overflow: hidden; box-sizing: content-box; }
li p.first { display: inline-block; }
ul, ol { padding-left: 30px; }
ul:first-child, ol:first-child { margin-top: 0px; }
ul:last-child, ol:last-child { margin-bottom: 0px; }
blockquote { border-left: 4px solid rgb(223, 226, 229); padding: 0px 15px; color: rgb(119, 119, 119); }
blockquote blockquote { padding-right: 0px; }
table { padding: 0px; word-break: initial; }
table tr { border-top: 1px solid rgb(223, 226, 229); margin: 0px; padding: 0px; }
table tr:nth-child(2n), thead { background-color: rgb(248, 248, 248); }
table tr th { font-weight: bold; border-width: 1px 1px 0px; border-top-style: solid; border-right-style: solid; border-left-style: solid; border-top-color: rgb(223, 226, 229); border-right-color: rgb(223, 226, 229); border-left-color: rgb(223, 226, 229); border-image: initial; border-bottom-style: initial; border-bottom-color: initial; text-align: left; margin: 0px; padding: 6px 13px; }
table tr td { border: 1px solid rgb(223, 226, 229); text-align: left; margin: 0px; padding: 6px 13px; }
table tr th:first-child, table tr td:first-child { margin-top: 0px; }
table tr th:last-child, table tr td:last-child { margin-bottom: 0px; }
.CodeMirror-lines { padding-left: 4px; }
.code-tooltip { box-shadow: rgba(0, 28, 36, 0.3) 0px 1px 1px 0px; border-top: 1px solid rgb(238, 242, 242); }
.md-fences, code, tt { border: 1px solid rgb(231, 234, 237); background-color: rgb(248, 248, 248); border-radius: 3px; padding: 2px 4px 0px; font-size: 0.9em; }
code { background-color: rgb(243, 244, 244); padding: 0px 2px; }
.md-fences { margin-bottom: 15px; margin-top: 15px; padding-top: 8px; padding-bottom: 6px; }
.md-task-list-item > input { margin-left: -1.3em; }
@media print {
  html { font-size: 13px; }
  table, pre { break-inside: avoid; }
  pre { overflow-wrap: break-word; }
}
.md-fences { background-color: rgb(248, 248, 248); }
#write pre.md-meta-block { padding: 1rem; font-size: 85%; line-height: 1.45; background-color: rgb(247, 247, 247); border: 0px; border-radius: 3px; color: rgb(119, 119, 119); margin-top: 0px !important; }
.mathjax-block > .code-tooltip { bottom: 0.375rem; }
.md-mathjax-midline { background: rgb(250, 250, 250); }
#write > h3.md-focus::before { left: -1.5625rem; top: 0.375rem; }
#write > h4.md-focus::before { left: -1.5625rem; top: 0.285714rem; }
#write > h5.md-focus::before { left: -1.5625rem; top: 0.285714rem; }
#write > h6.md-focus::before { left: -1.5625rem; top: 0.285714rem; }
.md-image > .md-meta { border-radius: 3px; padding: 2px 0px 0px 4px; font-size: 0.9em; color: inherit; }
.md-tag { color: rgb(167, 167, 167); opacity: 1; }
.md-toc { margin-top: 20px; padding-bottom: 20px; }
.sidebar-tabs { border-bottom: none; }
#typora-quick-open { border: 1px solid rgb(221, 221, 221); background-color: rgb(248, 248, 248); }
#typora-quick-open-item { background-color: rgb(250, 250, 250); border-color: rgb(254, 254, 254) rgb(229, 229, 229) rgb(229, 229, 229) rgb(238, 238, 238); border-style: solid; border-width: 1px; }
.on-focus-mode blockquote { border-left-color: rgba(85, 85, 85, 0.12); }
header, .context-menu, .megamenu-content, footer { font-family: "Segoe UI", Arial, sans-serif; }
.file-node-content:hover .file-node-icon, .file-node-content:hover .file-node-open-state { visibility: visible; }
.mac-seamless-mode #typora-sidebar { background-color: var(--side-bar-bg-color); }
.md-lang { color: rgb(180, 101, 77); }
.html-for-mac .context-menu { --item-hover-bg-color: #E6F0FE; }
#md-notification .btn { border: 0px; }
.dropdown-menu .divider { border-color: rgb(229, 229, 229); }
.ty-preferences .window-content { background-color: rgb(250, 250, 250); }
.ty-preferences .nav-group-item.active { color: white; background: rgb(153, 153, 153); }


</style>
</head>
<body class='typora-export os-windows' >
<div  id='write'  class = 'is-node'><h1><a name="fast_responder-快捷响应服务" class="md-header-anchor"></a><span>Fast_Responder 快捷响应服务</span></h1><p><span>v1.0.0-2022.01.17</span></p><h2><a name="简介" class="md-header-anchor"></a><span>简介</span></h2><p><span>		</span><span>Fast_Responder是一个可以让你快速创建Http请求应答器(responder)的服务。应答器可以接收配置的任意请求路径的请求，并按照你的配置对请求参数进行判断，以返回不同的结果。除了处理请求外，应答器还可以对任意个请求地址按你配置的延迟时间，请求头和参数发起Http请求。本质上，fast_responder是一个动态mock服务。</span></p><p><span>你可以在这里获取该项目的服务端和客户端源码(客户端不是非必须的,但是建议使用)</span></p><ol start='' ><li><span>github: </span><a href='https://github.com/Silwings-git' target='_blank' class='url'>https://github.com/Silwings-git</a></li><li><span>gitee: </span><a href='https://gitee.com/silwings' target='_blank' class='url'>https://gitee.com/silwings</a></li></ol><p><span>如有建议或疑问，欢迎给我发送邮件说明，感谢您的意见.</span></p><p><span>邮箱: </span><a href='mailto:silwings@163.com' target='_blank' class='url'>silwings@163.com</a></p><p>&nbsp;</p><h2><a name="适用场景" class="md-header-anchor"></a><span>适用场景</span></h2><p><span>写这个服务主要是为了应对工作中遇到的一些特殊场景，比如：</span></p><ol start='' ><li><p><span>对接第三方接口时,对方提供的接口没有测试环境，或有调用次数限制。</span></p><ol start='' ><li><span>如果三方接口有调用次数限制（如某签约服务测试环境发起合同次数有限制），可以将需要调用的接口创建为一个应答器，设置合理的返回值，就可以先调试流程代码，确认流程没问题后切换请求域名，调用实际接口，减少对三方接口的调用次数。</span></li></ol></li><li><p><span>团队合作时，所开发的功能需要依赖同事的接口，但同事还没完成接口开发（前端-后端，后端-后端）。</span></p><ol start='' ><li><span>这种情况下通常是自己mock一些数据进行调试，可以将这些mock数据创建到应答器中，方便重复利用，同时避免mock代码忘记删除等意外情况。</span></li></ol></li><li><p><span>要调用的接口是发起一个操作流程，操作完成后会对我方进行回调。但发起操作流程后，该流程难以完成，或耗时很长。</span></p><ol start='' ><li><span>通过使用应答器来响应发起操作流程的接口，并主动对预定接口进行回调，进而跳过该操作流程，使主流程和次流程拆分。</span></li></ol></li></ol><p><code>*</code><span>该服务不适合数据交互需要加解密的场景</span></p><p>&nbsp;</p><h2><a name="使用说明" class="md-header-anchor"></a><span>使用说明</span></h2><h4><a name="安装说明" class="md-header-anchor"></a><span>安装说明</span></h4><p><span>运行该服务仅需要一个Mysql服务，要求不低于8.0版本。</span></p><ol start='' ><li><span>在数据库执行项目下src\sqls\init.sql文件</span></li><li><span>修改配置文件的数据库配置</span></li><li><span>运行FastResponderApplication</span></li></ol><h4><a name="配置示例" class="md-header-anchor"></a><span>配置示例</span></h4><pre spellcheck="false" class="md-fences md-end-block ty-contain-cm modeLoaded" lang="json" style="break-inside: unset;"><div class="CodeMirror cm-s-inner CodeMirror-wrap" lang="json"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 0px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: none;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: none;"><div class="CodeMirror-measure"><span><span>​</span>x</span></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">{</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-string cm-property">"name"</span>:<span class="cm-string">"Demo config"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-string cm-property">"httpMethod"</span>:<span class="cm-string">"GET"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-string cm-property">"keyUrl"</span>:<span class="cm-string">"/demo/url"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-string cm-property">"categoryName"</span>:<span class="cm-string">"示例配置"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-string cm-property">"delayTime"</span>:<span class="cm-number">0</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-string cm-property">"tasks"</span>:[</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp;  {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-string cm-property">"conditions"</span>:[</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-string">"1 == 1"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-string">"${age} &amp;gt;= 10"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-string">"name =IsNotBlank="</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ],</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-string cm-property">"content"</span>:{</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-string cm-property">"body"</span>:{</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-string cm-property">"timestemp"</span>:<span class="cm-string">"-TSNow(ms)-"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-string cm-property">"name"</span>:<span class="cm-string">"${name}"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-string cm-property">"id"</span>:<span class="cm-string">"-UUID()-"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  },</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-string cm-property">"headers"</span>:{</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-string cm-property">"authToken"</span>:<span class="cm-string">"8888888888"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  },</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-string cm-property">"httpMethod"</span>:<span class="cm-string">"POST"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-string cm-property">"params"</span>:{</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-string cm-property">"keyA"</span>:[</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-string">"key_Av1"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-string">"keyA_v2"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ],</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-string cm-property">"keyB"</span>:[</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-string">"keyB_v1"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ]</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  },</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-string cm-property">"requestUrl"</span>:<span class="cm-string">"http://localhost:8088/hello/word"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  },</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-string cm-property">"delayTime"</span>:<span class="cm-number">2000</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-string cm-property">"name"</span>:<span class="cm-string">"My http task"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp;  }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  ],</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp;<span class="cm-string cm-property">"results"</span>:[</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp;  {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-string cm-property">"body"</span>:<span class="cm-atom">null</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-string cm-property">"conditions"</span>:[</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-string">"${age} == 18"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ],</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-string cm-property">"headers"</span>:{</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-string cm-property">"authToken"</span>:<span class="cm-string">"-TSFNow(yyyy-MM-dd HH:mm:ss)-"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  },</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-string cm-property">"msg"</span>:<span class="cm-string">"Hello Word !"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-string cm-property">"resultName"</span>:<span class="cm-string">"My Result A"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp;  },</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp;  {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-string cm-property">"body"</span>:<span class="cm-atom">null</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-string cm-property">"conditions"</span>:[</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-string">"${age} == 15"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  ],</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-string cm-property">"headers"</span>:{</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="">​</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  },</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-string cm-property">"msg"</span>:<span class="cm-atom">null</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="cm-string cm-property">"resultName"</span>:<span class="cm-string">"My Result B"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp; &nbsp; &nbsp;  }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> &nbsp;  ]</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom: 0px solid transparent; top: 1411px;"></div><div class="CodeMirror-gutters" style="display: none; height: 1411px;"></div></div></div></pre><p><span>字段信息</span></p><figure><table><thead><tr><th><span>主体</span></th><th><span>类型</span></th><th><span>描述</span></th><th><span>必填</span></th></tr></thead><tbody><tr><td><span>name</span></td><td><span>string</span></td><td><span>应答器名称</span></td><td><span>true</span></td></tr><tr><td><span>httpMethod</span></td><td><span>string</span></td><td><span>应答请求方式(大写)</span></td><td><span>true</span></td></tr><tr><td><span>keyUrl</span></td><td><span>string</span></td><td><span>应答地址</span></td><td><span>true</span></td></tr><tr><td><span>categoryName</span></td><td><span>string</span></td><td><span>应答器分类名称</span></td><td><span>false</span></td></tr><tr><td><span>delayTime</span></td><td><span>long</span></td><td><span>应答器响应延迟时间(ms),默认0</span></td><td><span>false</span></td></tr><tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><span>tasks</span></td><td><span>array</span></td><td><span>应答器的任务集</span></td><td><span>false</span></td></tr><tr><td><span>|</span><span>--name</span></td><td><span>string</span></td><td><span>任务名称</span></td><td><span>true</span></td></tr><tr><td><span>|</span><span>--delayTime</span></td><td><span>long</span></td><td><span>延迟时间(ms),默认0</span></td><td><span>false</span></td></tr><tr><td><span>|</span><span>--conditions</span></td><td><span>array</span></td><td><span>任务执行条件</span></td><td><span>false</span></td></tr><tr><td><span>|</span><span>--content</span></td><td><span>obj</span></td><td><span>任务内容</span></td><td><span>true</span></td></tr><tr><td><span>|</span><span>--</span><span>|</span><span>--httpMethod</span></td><td><span>string</span></td><td><span>请求方式(大写)</span></td><td><span>true</span></td></tr><tr><td><span>|</span><span>--</span><span>|</span><span>--requestUrl</span></td><td><span>string</span></td><td><span>请求地址</span></td><td><span>true</span></td></tr><tr><td><span>|</span><span>--</span><span>|</span><span>--headers</span></td><td><span>map</span></td><td><span>请求头</span></td><td><span>false</span></td></tr><tr><td><span>|</span><span>--</span><span>|</span><span>--params</span></td><td><span>map</span></td><td><span>请求参数(注意value为字符数组)</span></td><td><span>false</span></td></tr><tr><td><span>|</span><span>--</span><span>|</span><span>--body</span></td><td><span>obj</span></td><td><span>请求体</span></td><td><span>false</span></td></tr><tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><span>results</span></td><td><span>array</span></td><td><span>返回值列表</span></td><td><span>false</span></td></tr><tr><td><span>|</span><span>--resultName</span></td><td><span>string</span></td><td><span>返回值名称</span></td><td><span>true</span></td></tr><tr><td><span>|</span><span>--body</span></td><td><span>obj</span></td><td><span>响应体</span></td><td><span>false</span></td></tr><tr><td><span>|</span><span>--msg</span></td><td><span>string</span></td><td><span>响应内容(只有body为null才返回msg)</span></td><td><span>false</span></td></tr><tr><td><span>|</span><span>--conditions</span></td><td><span>array</span></td><td><span>返回执行条件</span></td><td><span>false</span></td></tr><tr><td><span>|</span><span>--headers</span></td><td><span>map</span></td><td><span>响应头</span></td><td><span>false</span></td></tr></tbody></table></figure><p>&nbsp;</p><h4><a name="字段简述" class="md-header-anchor"></a><span>字段简述</span></h4><ol start='' ><li><span>应答器配置主要由应答器名称，应答地址，应答请求方式，任务集，返回值集五个部分组成。</span></li><li><span>应答地址和应答请求方式的组合是唯一的。如果出现冲突会在保存时提示。</span></li><li><span>应答地址必须以&quot;/&quot;开头</span></li><li><span>应答请求方式的取值范围： GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, TRACE（使用客户端添加应答器时可以不区分大小写）。</span></li><li><span>应答器响应延迟时间（delayTime）为接收到请求后，最快应该在多少ms外响应（注意是外，不是内）。</span></li><li><span>应答器任务集：可配置http请求任务，task会按顺序判断条件，计算通过后创建task，在指定延迟后发起http请求。</span></li><li><span>返回值集： 可配置多个返回值，按照顺序执行，当某一个返回值条件满足时立即返回。</span></li></ol><p>&nbsp;</p><h4><a name="task说明" class="md-header-anchor"></a><span>Task说明</span></h4><ol start='' ><li><p><span>当应答器中包含task时，在应答器对接口进行响应之前，会先遍历task集，依次判断执行条件（conditions，如果conditions 是empty，默认为true 。conditions说明见下文），如果条件判断为true，会创建task任务，等待执行。</span></p></li><li><p><span>所有task任务会被缓存在一个无界延迟队列（DelayQueue）中，按照delayTime排序。如果配置的延迟时间相同，多个task可能同时执行（多线程）。</span></p></li><li><p><span>task任务目前提供三个自定义配置</span></p><ol start='' ><li><span>httptask.scheduler.thread-pool-size：设置执行task任务的线程池的核心线程数。默认5</span></li><li><span>httptask.resttemplate.connect-timeout：请求连接超时时间。默认20000（ms）</span></li><li><span>httptask.resttemplate.read-timeout：请求读取时间。默认20000（ms）</span></li></ol></li><li><p><span>task任务中配置的执行条件（conditions），请求地址（requestUrl），请求头（headers），参数（params），请求体（body）均适用</span><code>替换操作符</code><span>,替换操作符可以对字符进行一些特定处理（见下文）。</span></p></li></ol><p>&nbsp;</p><h4><a name="result说明" class="md-header-anchor"></a><span>Result说明</span></h4><ol start='' ><li><span>当应答器包含result时，在请求处理的最后阶段，会按顺序遍历result集，依次判断执行条件，如果判断为true，会立即将当前result作为响应进行返回。</span></li><li><span>可以配置两种类型的返回值。一是返回一个简单的字符串，二是返回一个对象，分别通过msg和body设置。但如果msg和body同时存在，会优先以body返回。例外的是如果运算结果无法转换为对象，会用无法转换的数据替换msg中原本的值。</span></li><li><span>result中配置的响应条件（conditions），响应头（headers），响应内容（msg，body）均适用</span><code>替换操作符</code><span>（见下文）。</span></li></ol><p>&nbsp;</p><h4><a name="condition说明" class="md-header-anchor"></a><span>condition说明</span></h4><p><span>条件（condition）是用来确定task或result是否执行的表达式（Expression）集，也就是一个集合为一个condition。配置格式为在集合中添加条件表达式。</span></p><ol start='' ><li><p><span>集合中的每一个元素（表达式）之间的关系可以理解为Java中的</span><code>&amp;&amp;</code><span>，当前一个表达式结果为false时，后面的表达式不计算，整个condition直接返回false。</span></p></li><li><p><span>如果条件集合为empty，该condition返回true。</span></p></li><li><p><span>表达式格式：参数A+空格+条件符号+空格+参数B。其中参数A和参数B为必填。如果条件符号只需要左条件（参数A），参数B可以不写。条件表达式的三个元素之间的空格不可省略。</span></p></li><li><p><span>条件符号</span></p><ol start='' ><li><p><span>等值条件</span></p><ol start='' ><li><p><strong><span>==</span></strong></p><ol start='' ><li><span>如果参数A和参数B相等返回true。</span></li><li><span>不区分数据类型，均按照字符串equals进行比较</span></li><li><span>全条件符号，可以是任意数值或字符</span></li></ol></li><li><p><strong><span>!=</span></strong></p><ol start='' ><li><span>==的取反</span></li><li><span>全条件符号，可以是任意数值或字符</span></li></ol></li></ol></li><li><p><span>数值条件</span></p><ol start='' ><li><p><strong><span>&gt;</span></strong></p></li><li><p><strong><span>&gt;=</span></strong></p></li><li><p><strong><span>&lt;</span></strong></p></li><li><p><strong><span>&lt;=</span></strong></p><ol start='' ><li><span>区分数据类型，如果参数A和参数B均可以转换为数值类型，会按照比较符号逻辑进行比较，参数A或参数B有不能转换为数值的，直接返回false</span></li><li><span>全条件符号</span></li></ol></li></ol></li><li><p><span>空判条件</span></p><ol start='' ><li><p><strong><span>=IsNull=</span></strong></p></li><li><p><strong><span>=IsNotNull=</span></strong></p></li><li><p><strong><span>=IsBlank=</span></strong></p></li><li><p><strong><span>=IsNotBlank=</span></strong></p><ol start='' ><li><span>这四种表达式运算逻辑参考org.apache.commons.lang3.StringUtils的对应方法。</span></li><li><span>左条件符号，只需要参数A有值即可。</span></li></ol></li></ol></li></ol></li><li><p><span>注意事项！</span></p><ol start='' ><li><span>param参数比较特殊，因为其值是一个数组，所有在需要对url参数进行比对时，只有当param数组只有一个值时，才能正常生效。否则需要手动配置待比较的值为一个数组，并区分数组中是字符还是数值。</span></li></ol></li></ol><p>&nbsp;</p><h4><a name="replaceoperator替换操作符" class="md-header-anchor"></a><span>ReplaceOperator替换操作符</span></h4><p><span>替换操作符可以对字符串进行特殊处理，如生成数据，引用数据，通过和condition组合可以进行动态逻辑判断。</span></p><p><span>同一个字符串中可以添加多个替换操作符，但不允许嵌套。</span></p><ol start='' ><li><p><span>操作符介绍</span></p><ol start='' ><li><p><strong><span>${}</span></strong></p><p><span>查询替换符，可以从请求信息参数（param，path param，body）中获取指定字段的值来对符号所在位置进行替换。通过在{}之间添加文本来指定字段，支持简单Json Path语法和标准Json Path语法，如果对标准Json Path不熟悉，可以使用简单Json Path快速上手。</span></p><ol start='' ><li><p><span>简单Json Path语法（该语法为我自定义的简单语法）</span></p><ol start='' ><li><p><span>查找最外层key：直接填写字段名</span></p></li><li><p><span>查找内层key：填写多个字段名，之间使用英文字符  </span><strong><span>.</span></strong><span>  分隔</span></p></li><li><p><span>查找数组指定角标：填写字段名+[]，[]内填写有效角标值。例：studentList[0]，意为获取studentList的0角标对象</span></p></li><li><p><span>查找替换示例1：</span></p><ol start='' ><li><span>返回值msg：”你好，我叫${student.name},今年${student.age}岁“。</span></li><li><span>请求应答器的请求的请求体：{&quot;code&quot;:&quot;200&quot;,&quot;student&quot;:{&quot;name&quot;:&quot;小明&quot;,&quot;age&quot;:20}}</span></li><li><span>得到的结果msg：”你好，我叫小明,今年20岁“</span></li></ol></li><li><p><span>示例2：</span></p><ol start='' ><li><span>返回值msg：”你好，我叫${name},今年${age}岁“。</span></li><li><span>请求应答器的请求：</span><a href='http://localhost:8080/getStudent?name=' target='_blank' class='url'>http://localhost:8080/getStudent?name=</a><span>小明&amp;age=20</span></li><li><span>得到的结果msg：”你好，我叫小明,今年20岁“</span></li><li><span>如果指定的key对应的值是一个对象，将得到一个对象或对象的json字符串</span></li></ol></li><li><p><span>示例3：</span></p><ol start='' ><li><span>返回值msg：”你好，我叫${name},今年${age}岁“。</span></li><li><span>配置的应答地址： </span><a href='http://localhost:8080/getStudent/' target='_blank' class='url'>http://localhost:8080/getStudent/</a><span>{name}/{age}</span></li><li><span>请求应答器的请求：</span><a href='http://localhost:8080/getStudent/' target='_blank' class='url'>http://localhost:8080/getStudent/</a><span>小明/20</span></li><li><span>得到的结果msg：”你好，我叫小明,今年20岁“</span></li></ol></li></ol></li><li><p><span>标准Json Path</span></p><p><span>标准Json Path指由Fast Json提供的Json Path语法规则，该语法可被JSONPath类解析。语法规则如下（想要了解更多信息请阅读fast json相关文档）：</span></p><figure><table><thead><tr><th><span>JSONPATH</span></th><th><span>描述</span></th></tr></thead><tbody><tr><td><span>$</span></td><td><span>根对象，例如$.name</span></td></tr><tr><td><span>[num]</span></td><td><span>数组访问，其中num是数字，可以是负数。例如$[0].leader.departments[-1].name</span></td></tr><tr><td><span>[num0,num1,num2...]</span></td><td><span>数组多个元素访问，其中num是数字，可以是负数，返回数组中的多个元素。例如$[0,3,-2,5]</span></td></tr><tr><td><span>[start:end]</span></td><td><span>数组范围访问，其中start和end是开始小表和结束下标，可以是负数，返回数组中的多个元素。例如$[0:5]</span></td></tr><tr><td><span>[start:end :step]</span></td><td><span>数组范围访问，其中start和end是开始小表和结束下标，可以是负数；step是步长，返回数组中的多个元素。例如$[0:5:2]</span></td></tr><tr><td><span>[?(key)]</span></td><td><span>对象属性非空过滤，例如$.departs[?(name)]</span></td></tr><tr><td><span>[key &gt; 123]</span></td><td><span>数值类型对象属性比较过滤，例如$.departs[id &gt;= 123]，比较操作符支持=,!=,&gt;,&gt;=,&lt;,&lt;=</span></td></tr><tr><td><span>[key = &#39;123&#39;]</span></td><td><span>字符串类型对象属性比较过滤，例如$.departs[name = &#39;123&#39;]，比较操作符支持=,!=,&gt;,&gt;=,&lt;,&lt;=</span></td></tr><tr><td><span>[key like &#39;aa%&#39;]</span></td><td><span>字符串类型like过滤， 例如$.departs[name like &#39;sz*&#39;]，通配符只支持%  支持not like</span></td></tr><tr><td><span>[key rlike &#39;regexpr&#39;]</span></td><td><span>字符串类型正则匹配过滤， 例如departs[name like &#39;aa(.)*&#39;]， 正则语法为jdk的正则语法，支持not rlike</span></td></tr><tr><td><span>[key in (&#39;v0&#39;, &#39;v1&#39;)]</span></td><td><span>IN过滤, 支持字符串和数值类型  例如:  $.departs[name in (&#39;wenshao&#39;,&#39;Yako&#39;)]  $.departs[id not in (101,102)]</span></td></tr><tr><td><span>[key between 234 and 456]</span></td><td><span>BETWEEN过滤, 支持数值类型，支持not between  例如:  $.departs[id between 101 and 201] $.departs[id not between 101 and 201]</span></td></tr><tr><td><span>length() 或者 size()</span></td><td><span>数组长度。例如$.values.size()  支持类型java.util.Map和java.util.Collection和数组</span></td></tr><tr><td><span>.</span></td><td><span>属性访问，例如$.name</span></td></tr><tr><td><span>..</span></td><td><span>deepScan属性访问，例如$..name</span></td></tr><tr><td><span>*</span></td><td><span>对象的所有属性，例如$.leader.*</span></td></tr><tr><td><span>[&#39;key&#39;]</span></td><td><span>属性访问。例如$[&#39;name&#39;]</span></td></tr><tr><td><span>[&#39;key0&#39;,&#39;key1&#39;]</span></td><td><span>多个属性访问。例如$[&#39;id&#39;,&#39;name&#39;]</span></td></tr></tbody></table></figure></li><li><p><span>简单path和标准path在使用上的区别：</span></p><ol start='' ><li><span>简单版除了body，还支持从param，path param中查找，而标准版仅支持从请求体body中查找。</span></li><li><span>简单版仅提供简单的键值查询，标准版提供的查询更加多样性。</span></li></ol></li><li><p><span>简单版和标准版共存，是否会导致取值错误？</span></p><ol start='' ><li><span>设计上，简单版和标准版仅有  </span><em><span>从集合获取指定一个角标处的值</span></em><span>  的语法相同，所以也只有这里可能会发生简单版和标准版冲突的情况。（这段语法设计为相同是为防止对使用者学习标准Json Path造成负面影响而有意为之）</span></li><li><span>如果简单版和标准版均获取到了值，将优先获取标准版的结果</span></li></ol></li></ol></li><li><p><strong><span>-RDBoolean()-</span></strong></p><ol start='' ><li><p><span>随机一个布尔值替换掉操作符</span></p></li><li><p><span>示例：</span></p><ol start='' ><li><span>字符串： “这是一个随机布尔值：-RDBoolean()-”</span></li><li><span>结果：  “这是一个随机布尔值：true”</span></li></ol></li></ol></li><li><p><strong><span>-RDInt()-</span></strong></p><ol start='' ><li><p><span>随机一个int数值替换掉操作符</span></p></li><li><p><span>可以在（）中传递参数（下列10,-5,20均为示例值，可换其他值）。</span></p><ol start='' ><li><span>-RDInt()-：返回一个伪随机int值。</span></li><li><span>-RDInt(10)-：返回0（包含）到10（不包含）直接的位随机数int值。</span></li><li><span>-RDInt(-5，20)-：返回-5（包括）和20（不包括）之间的伪随机int值。</span></li></ol></li></ol></li><li><p><strong><span>-RDLong()-</span></strong></p><ol start='' ><li><p><span>随机一个long数值替换掉操作符</span></p></li><li><p><span>可以在（）中传递参数（下列10,-5,20均为示例值，可换其他值）。</span></p><ol start='' ><li><span>-RDLong()-：返回一个伪随机long值。</span></li><li><span>-RDLong(10)-：返回0（包括）和10（不包括）之间的伪随机long值。</span></li><li><span>-RDLong(-5,20)-：返回-5（包括）和20（不包括）之间的伪随机long值。</span></li></ol></li></ol></li><li><p><strong><span>-RDDouble()-</span></strong></p><ol start='' ><li><p><span>随机一个double数值替换掉操作符</span></p></li><li><p><span>可以在（）中传递参数（下列10.0,-5.0,1.0均为示例值，可换其他值）。</span></p><ol start='' ><li><span>-RDDouble()-：返回0（包括）和1（不包括）之间的伪随机double值。</span></li><li><span>-RDDouble(10.0)-：返回介于 0.0（包括）和10.0（不包括）之间的伪随机double值。</span></li><li><span>-RDDouble(-5.0,1.0)-：返回-5.0（包括）和1.0（不包括）之间的伪随机double值。</span></li></ol></li></ol></li><li><p><strong><span>-UUID()-</span></strong></p><ol start='' ><li><p><span>随机一个uuid替换掉操作符</span></p></li><li><p><span>可以在（）中传递限制长度（下列16,64均为示例值，可换其他值）。</span></p><ol start='' ><li><span>-UUID()-：返回一个uuid字符</span></li><li><span>-UUID(16)-：使用substring函数将uuid裁剪到长度16</span></li><li><span>-UUID(64)-：循环拼接生成的uuid，知道长度到达64</span></li></ol></li></ol></li><li><p><strong><span>-TSNow()-</span></strong></p><ol start='' ><li><p><span>生成当前时间的时间戳替换掉操作符</span></p></li><li><p><span>可以在（）中传递参数,ms和s为固定值，只能二选一</span></p><ol start='' ><li><span>-TSNow()-：时间戳，单位ms</span></li><li><span>-TSNow(ms)-：生成毫秒值时间戳</span></li><li><span>-TSNow(s)-：生成秒值时间戳</span></li></ol></li></ol></li><li><p><strong><span>-TSFNow()-</span></strong></p><ol start='' ><li><p><span>根据指定格式生成时间</span></p></li><li><p><span>可以在（）中传递参数（下列yyyy-MM-dd HH:mm:ss为示例值,可切换其他正确时间格式）</span></p><ol start='' ><li><span>-TSFNow()-：同“-TSNow()-”</span></li><li><span>-TSFNow(yyyy-MM-dd HH:mm:ss)-：将当前时间转换为“yyyy-MM-dd HH:mm:ss”格式返回</span></li></ol></li></ol></li></ol></li></ol><p>&nbsp;</p><h2><a name="客户端操作与功能演示" class="md-header-anchor"></a><span>客户端操作与功能演示</span></h2><p><span>强烈推荐使用Web客户端对应答器进行维护。你可以在我的仓库中找到它。</span></p><p><span>使用</span><strong><span>配置示例</span></strong><span>中的应答器进行演示。</span></p><ol start='' ><li><p><span>创建并启用应答器</span></p><p><img src='images/1642343289387.png' alt='1642343289387' referrerPolicy='no-referrer' /></p><p><img src='images/1642343524290.png' alt='1642343524290' referrerPolicy='no-referrer' /></p><p><img src='images/1642346203911.png' alt='1642347203609' referrerPolicy='no-referrer' /></p><p><img src='images/1642346284473.png' alt='1642347272450' referrerPolicy='no-referrer' /></p><p><img src='images/1642343787434.png' alt='1642343787434' referrerPolicy='no-referrer' /></p><p><img src='images/1642344847804.png' alt='1642344847804' referrerPolicy='no-referrer' /></p></li><li><p><span>启动用于回调的测试服务,其中包含如下web接口</span></p><p><img src='images/1642609105185.png' alt='1642609105185' referrerPolicy='no-referrer' /></p></li><li><p><span>Postman测试</span></p><ol start='' ><li><p><span>不触发任务和返回值</span></p><p><img src='images/1642346520482.png' alt='1642346520482' referrerPolicy='no-referrer' /></p></li><li><p><span>触发ResultA</span></p><p><img src='images/1642348536310.png' alt='1642348536310' referrerPolicy='no-referrer' /></p><p><img src='images/1642349878557.png' alt='1642349878557' referrerPolicy='no-referrer' /></p></li><li><p><span>触发ResultB</span></p><p><img src='images/1642348680982.png' alt='1642348680982' referrerPolicy='no-referrer' /></p></li><li><p><span>触发Task,ResultB</span></p><p><img src='images/1642349083316.png' alt='1642349083316' referrerPolicy='no-referrer' /></p><p><img src='images/1642349704066.png' alt='1642349704066' referrerPolicy='no-referrer' /></p></li></ol></li><li><p><span>查看日志</span></p><p><span>		</span><span>实际使用过程中，经常会需要确认task或项目执行情况，如果只能通过控制台查看会比较麻烦，Fast Responder客户端提供了实时日志查看功能。默认日志等级INFO，可通过配置文件（logback.xml）调整。日志接口默认各接收最多同时10个连接，有新连接进入时，最早连接的连接将被断开。</span></p><ol start='' ><li><p><span>task日志，仅打印task执行线程的日志</span></p><p><img src='images/1642350151744.png' alt='1642350151744' referrerPolicy='no-referrer' /></p><p><img src='images/1642350168316.png' alt='1642350168316' referrerPolicy='no-referrer' /></p></li><li><p><span>项目日志，打印项目的全部日志</span></p><p><img src='images/1642350192452.png' alt='1642350192452' referrerPolicy='no-referrer' /></p><p><img src='images/1642350210109.png' alt='1642350210109' referrerPolicy='no-referrer' /></p></li></ol></li></ol><p><span>tips: </span></p><ol start='' ><li><p><span>进行过编辑后，会自动禁用，需要重新启用。</span></p></li><li><p><span>keyUrl和httpMethod的组合应该是唯一的，但数据库并没有做限制，所有如果出现重复并同时启用的情况，将按照数据库默认排序获取第一个结果。</span></p><p><span>   </span></p></li></ol><p><span>感谢你的阅读! </span></p><p><span>																																									</span><span>Silwings</span></p><p><span>																																								</span><span>2022-01-07</span></p></div>
</body>
</html>